Updated agent descriptions to ensure compatibility with new agent picker

Dustin Miller %!s(int64=9) %!d(string=hace) años
padre
commit
e0188d686e

+ 14 - 18
app/models/agents/data_output_agent.rb

@@ -2,28 +2,26 @@ module Agents
2 2
   class DataOutputAgent < Agent
3 3
     cannot_be_scheduled!
4 4
 
5
-    description  do
6
-      <<-MD
7
-        The Agent outputs received events as either RSS or JSON.  Use it to output a public or private stream of Huginn data.
5
+    description <<-MD
6
+      The Agent outputs received events as either RSS or JSON.  Use it to output a public or private stream of Huginn data.
8 7
 
9
-        This Agent will output data at:
8
+      This Agent will output data at:
10 9
 
11
-        `https://#{ENV['DOMAIN']}/users/#{user.id}/web_requests/#{id || '<id>'}/:secret.xml`
10
+      `https://\#{ENV['DOMAIN']}/users/\#{user.id}/web_requests/\#{id || '<id>'}/:secret.xml`
12 11
 
13
-        where `:secret` is one of the allowed secrets specified in your options and the extension can be `xml` or `json`.
12
+      where `:secret` is one of the allowed secrets specified in your options and the extension can be `xml` or `json`.
14 13
 
15
-        You can setup multiple secrets so that you can individually authorize external systems to
16
-        access your Huginn data.
14
+      You can setup multiple secrets so that you can individually authorize external systems to
15
+      access your Huginn data.
17 16
 
18
-        Options:
17
+      Options:
19 18
 
20
-          * `secrets` - An array of tokens that the requestor must provide for light-weight authentication.
21
-          * `expected_receive_period_in_days` - How often you expect data to be received by this Agent from other Agents.
22
-          * `template` - A JSON object representing a mapping between item output keys and incoming event values. Use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) to format the values. The `item` key will be repeated for every Event. The `pubDate` key for each item will have the creation time of the Event unless given.
23
-          * `events_to_show` - The number of events to output in RSS or JSON. (default: `40`)
24
-          * `ttl` - A value for the <ttl> element in RSS output. (default: `60`)
19
+        * `secrets` - An array of tokens that the requestor must provide for light-weight authentication.
20
+        * `expected_receive_period_in_days` - How often you expect data to be received by this Agent from other Agents.
21
+        * `template` - A JSON object representing a mapping between item output keys and incoming event values. Use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) to format the values. The `item` key will be repeated for every Event. The `pubDate` key for each item will have the creation time of the Event unless given.
22
+        * `events_to_show` - The number of events to output in RSS or JSON. (default: `40`)
23
+        * `ttl` - A value for the <ttl> element in RSS output. (default: `60`)
25 24
       MD
26
-    end
27 25
 
28 26
     def default_options
29 27
       {
@@ -110,7 +108,6 @@ module Agents
110 108
           return [content, 200]
111 109
         else
112 110
           content = Utils.unindent(<<-XML)
113
-            <?xml version="1.0" encoding="UTF-8" ?>
114 111
             <rss version="2.0">
115 112
             <channel>
116 113
              <title>#{feed_title.encode(:xml => :text)}</title>
@@ -119,10 +116,9 @@ module Agents
119 116
              <lastBuildDate>#{Time.now.rfc2822.to_s.encode(:xml => :text)}</lastBuildDate>
120 117
              <pubDate>#{Time.now.rfc2822.to_s.encode(:xml => :text)}</pubDate>
121 118
              <ttl>#{feed_ttl}</ttl>
122
-
123 119
           XML
124 120
 
125
-          content += items.to_xml(:skip_types => true, :root => "items", :skip_instruct => true, :indent => 1).gsub(/^<\/?items>/, '').strip
121
+          content += items.to_xml(:skip_instruct => true, :skip_types => true, :root => "items", :indent => 1).gsub(/^<\/?items>/, '').strip
126 122
 
127 123
           content += Utils.unindent(<<-XML)
128 124
             </channel>

+ 2 - 2
app/models/agents/dropbox_file_url_agent.rb

@@ -5,9 +5,9 @@ module Agents
5 5
     cannot_be_scheduled!
6 6
 
7 7
     description <<-MD
8
+      The _DropboxFileUrlAgent_ is used to work with Dropbox. It takes a file path (or multiple files paths) and emits events with [temporary links](https://www.dropbox.com/developers/core/docs#media).
9
+
8 10
       #{'## Include the `dropbox-api` and `omniauth-dropbox` gems in your `Gemfile` and set `DROPBOX_OAUTH_KEY` and `DROPBOX_OAUTH_SECRET` in your environment to use Dropbox Agents.' if dependencies_missing?}
9
-      The _DropboxFileUrlAgent_ is used to work with Dropbox. It takes a file path (or multiple files paths) and emits
10
-      events with [temporary links](https://www.dropbox.com/developers/core/docs#media).
11 11
 
12 12
       The incoming event payload needs to have a `paths` key, with a comma-separated list of files you want the URL for. For example:
13 13
 

+ 1 - 1
app/models/agents/dropbox_watch_agent.rb

@@ -6,8 +6,8 @@ module Agents
6 6
     default_schedule "every_1m"
7 7
 
8 8
     description <<-MD
9
-      #{'## Include the `dropbox-api` and `omniauth-dropbox` gems in your `Gemfile` and set `DROPBOX_OAUTH_KEY` and `DROPBOX_OAUTH_SECRET` in your environment to use Dropbox Agents.' if dependencies_missing?}
10 9
       The _DropboxWatchAgent_ watches the given `dir_to_watch` and emits events with the detected changes.
10
+      #{'## Include the `dropbox-api` and `omniauth-dropbox` gems in your `Gemfile` and set `DROPBOX_OAUTH_KEY` and `DROPBOX_OAUTH_SECRET` in your environment to use Dropbox Agents.' if dependencies_missing?}
11 11
     MD
12 12
 
13 13
     event_description <<-MD

+ 13 - 15
app/models/agents/rss_agent.rb

@@ -8,26 +8,24 @@ module Agents
8 8
     cannot_receive_events!
9 9
     default_schedule "every_1d"
10 10
 
11
-    description do
12
-      <<-MD
13
-        This Agent consumes RSS feeds and emits events when they change.
11
+    description <<-MD
12
+      This Agent consumes RSS feeds and emits events when they change.
14 13
 
15
-        This Agent is fairly simple, using [feed-normalizer](https://github.com/aasmith/feed-normalizer) as a base.  For complex feeds
16
-        with additional field types, we recommend using a WebsiteAgent.  See [this example](https://github.com/cantino/huginn/wiki/Agent-configuration-examples#itunes-trailers).
14
+      This Agent is fairly simple, using [feed-normalizer](https://github.com/aasmith/feed-normalizer) as a base.  For complex feeds
15
+      with additional field types, we recommend using a WebsiteAgent.  See [this example](https://github.com/cantino/huginn/wiki/Agent-configuration-examples#itunes-trailers).
17 16
 
18
-        If you want to *output* an RSS feed, use the DataOutputAgent.
17
+      If you want to *output* an RSS feed, use the DataOutputAgent.
19 18
 
20
-        Options:
19
+      Options:
21 20
 
22
-          * `url` - The URL of the RSS feed.
23
-          * `clean` - Attempt to use [feed-normalizer](https://github.com/aasmith/feed-normalizer)'s' `clean!` method to cleanup HTML in the feed.  Set to `true` to use.
24
-          * `expected_update_period_in_days` - How often you expect this RSS feed to change.  If more than this amount of time passes without an update, the Agent will mark itself as not working.
25
-          * `headers` - When present, it should be a hash of headers to send with the request.
26
-          * `basic_auth` - Specify HTTP basic auth parameters: `"username:password"`, or `["username", "password"]`.
27
-          * `disable_ssl_verification` - Set to `true` to disable ssl verification.
28
-          * `user_agent` - A custom User-Agent name (default: "Faraday v#{Faraday::VERSION}").
21
+        * `url` - The URL of the RSS feed.
22
+        * `clean` - Attempt to use [feed-normalizer](https://github.com/aasmith/feed-normalizer)'s' `clean!` method to cleanup HTML in the feed.  Set to `true` to use.
23
+        * `expected_update_period_in_days` - How often you expect this RSS feed to change.  If more than this amount of time passes without an update, the Agent will mark itself as not working.
24
+        * `headers` - When present, it should be a hash of headers to send with the request.
25
+        * `basic_auth` - Specify HTTP basic auth parameters: `"username:password"`, or `["username", "password"]`.
26
+        * `disable_ssl_verification` - Set to `true` to disable ssl verification.
27
+        * `user_agent` - A custom User-Agent name (default: "Faraday v\#{Faraday::VERSION}").
29 28
       MD
30
-    end
31 29
 
32 30
     def default_options
33 31
       {

+ 2 - 1
app/models/agents/twitter_publish_agent.rb

@@ -5,9 +5,10 @@ module Agents
5 5
     cannot_be_scheduled!
6 6
 
7 7
     description <<-MD
8
-      #{twitter_dependencies_missing if dependencies_missing?}
9 8
       The TwitterPublishAgent publishes tweets from the events it receives.
10 9
 
10
+      #{twitter_dependencies_missing if dependencies_missing?}
11
+
11 12
       To be able to use this Agent you need to authenticate with Twitter in the [Services](/services) section first.
12 13
 
13 14
       You must also specify a `message` parameter, you can use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) to format the message.

+ 3 - 2
app/models/agents/twitter_stream_agent.rb

@@ -5,9 +5,10 @@ module Agents
5 5
     cannot_receive_events!
6 6
 
7 7
     description <<-MD
8
-      #{twitter_dependencies_missing if dependencies_missing?}
9 8
       The TwitterStreamAgent follows the Twitter stream in real time, watching for certain keywords, or filters, that you provide.
10 9
 
10
+      #{twitter_dependencies_missing if dependencies_missing?}
11
+
11 12
       To follow the Twitter stream, provide an array of `filters`.  Multiple words in a filter must all show up in a tweet, but are independent of order.
12 13
       If you provide an array instead of a filter, the first entry will be considered primary and any additional values will be treated as aliases.
13 14
 
@@ -122,4 +123,4 @@ module Agents
122 123
       end
123 124
     end
124 125
   end
125
-end
126
+end

+ 2 - 1
app/models/agents/twitter_user_agent.rb

@@ -5,9 +5,10 @@ module Agents
5 5
     cannot_receive_events!
6 6
 
7 7
     description <<-MD
8
-      #{twitter_dependencies_missing if dependencies_missing?}
9 8
       The TwitterUserAgent follows the timeline of a specified Twitter user.
10 9
 
10
+      #{twitter_dependencies_missing if dependencies_missing?}
11
+
11 12
       To be able to use this Agent you need to authenticate with Twitter in the [Services](/services) section first.
12 13
 
13 14
       You must also provide the `username` of the Twitter user to monitor.

+ 7 - 9
app/models/agents/user_location_agent.rb

@@ -6,19 +6,17 @@ module Agents
6 6
 
7 7
     gem_dependency_check { defined?(Haversine) }
8 8
 
9
-    description do
10
-      <<-MD
11
-        #{'## Include `haversine` in your Gemfile to use this Agent!' if dependencies_missing?}
12
-        The UserLocationAgent creates events based on WebHook POSTS that contain a `latitude` and `longitude`.  You can use the [POSTLocation](https://github.com/cantino/post_location) or [PostGPS](https://github.com/chriseidhof/PostGPS) iOS app to post your location.
9
+    description <<-MD
10
+      The UserLocationAgent creates events based on WebHook POSTS that contain a `latitude` and `longitude`.  You can use the [POSTLocation](https://github.com/cantino/post_location) or [PostGPS](https://github.com/chriseidhof/PostGPS) iOS app to post your location.
13 11
 
12
+      #{'## Include `haversine` in your Gemfile to use this Agent!' if dependencies_missing?}
14 13
 
15
-        Your POST path will be `https://#{ENV['DOMAIN']}/users/#{user.id}/update_location/:secret` where `:secret` is specified in your options.
14
+      Your POST path will be `https://\#{ENV['DOMAIN']}/users/\#{user.id}/update_location/:secret` where `:secret` is specified in your options.
16 15
 
17
-        If you want to only keep more precise locations, set `max_accuracy` to the upper bound, in meters. The default name for this field is `accuracy`, but you can change this by setting a value for `accuracy_field`.
16
+      If you want to only keep more precise locations, set `max_accuracy` to the upper bound, in meters. The default name for this field is `accuracy`, but you can change this by setting a value for `accuracy_field`.
18 17
 
19
-        If you want to require a certain distance traveled, set `min_distance` to the minimum distance, in meters. Note that GPS readings and the measurement itself aren't exact, so don't rely on this for precision filtering.
20
-      MD
21
-    end
18
+      If you want to require a certain distance traveled, set `min_distance` to the minimum distance, in meters. Note that GPS readings and the measurement itself aren't exact, so don't rely on this for precision filtering.
19
+    MD
22 20
 
23 21
     event_description <<-MD
24 22
       Assuming you're using the iOS application, events look like this:

+ 14 - 15
app/models/agents/webhook_agent.rb

@@ -3,25 +3,24 @@ module Agents
3 3
     cannot_be_scheduled!
4 4
     cannot_receive_events!
5 5
 
6
-    description  do
7
-        <<-MD
8
-        Use this Agent to create events by receiving webhooks from any source.
6
+    description <<-MD
7
+      Use this Agent to create events by receiving webhooks from any source.
9 8
 
10
-        In order to create events with this agent, make a POST request to:
11
-        ```
12
-           https://#{ENV['DOMAIN']}/users/#{user.id}/web_requests/#{id || '<id>'}/:secret
13
-        ``` where `:secret` is specified in your options.
9
+      In order to create events with this agent, make a POST request to:
10
+      ```
11
+         https://\#{ENV['DOMAIN']}/users/\#{user.id}/web_requests/\#{id || '<id>'}/:secret
12
+      ``` where `:secret` is specified in your options.
14 13
 
15
-        Options:
14
+      Options:
16 15
 
17
-          * `secret` - A token that the host will provide for authentication.
18
-          * `expected_receive_period_in_days` - How often you expect to receive
19
-            events this way. Used to determine if the agent is working.
20
-          * `payload_path` - JSONPath of the attribute in the POST body to be
21
-            used as the Event payload.  If `payload_path` points to an array,
22
-            Events will be created for each element.
16
+        * `secret` - A token that the host will provide for authentication.
17
+        * `expected_receive_period_in_days` - How often you expect to receive
18
+          events this way. Used to determine if the agent is working.
19
+        * `payload_path` - JSONPath of the attribute in the POST body to be
20
+          used as the Event payload.  If `payload_path` points to an array,
21
+          Events will be created for each element.
23 22
       MD
24
-    end
23
+
25 24
 
26 25
     event_description do
27 26
       <<-MD

+ 2 - 3
app/models/agents/witai_agent.rb

@@ -3,9 +3,8 @@ module Agents
3 3
     cannot_be_scheduled!
4 4
 
5 5
     description <<-MD
6
-
7
-    `wit.ai` agent receives events, sends text query to your `wit.ai` instance and generates outcome events. Fill in `Server Access Token` of your `wit.ai` instance. Use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) to fill query field.
8
-    `expected_receive_period_in_days` is the expected number of days by which agent should receive events. It helps in determining if the agent is working.
6
+      The `wit.ai` agent receives events, sends text query to your `wit.ai` instance and generates outcome events. Fill in `Server Access Token` of your `wit.ai` instance. Use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) to fill query field.
7
+      `expected_receive_period_in_days` is the expected number of days by which agent should receive events. It helps in determining if the agent is working.
9 8
     MD
10 9
 
11 10
     event_description <<-MD

+ 3 - 4
app/models/agents/wunderlist_agent.rb

@@ -9,12 +9,11 @@ module Agents
9 9
     gem_dependency_check { Devise.omniauth_providers.include?(:wunderlist) }
10 10
 
11 11
     description <<-MD
12
-      #{'## Include the `omniauth-wunderlist` gem in your `Gemfile` and set `WUNDERLIST_OAUTH_KEY` and `WUNDERLIST_OAUTH_SECRET` in your environment to use this Agent' if dependencies_missing?}
12
+      The WunderlistAgent creates new Wunderlist tasks based on the incoming event.
13 13
 
14
-      The WunderlistAgent creates new new tasks based on the incoming event.
14
+      #{'## Include the `omniauth-wunderlist` gem in your `Gemfile` and set `WUNDERLIST_OAUTH_KEY` and `WUNDERLIST_OAUTH_SECRET` in your environment to use this Agent' if dependencies_missing?}
15 15
 
16 16
       To be able to use this Agent you need to authenticate with Wunderlist in the [Services](/services) section first.
17
-
18 17
     MD
19 18
 
20 19
     def default_options
@@ -75,4 +74,4 @@ module Agents
75 74
                     'X-Client-ID' => ENV["WUNDERLIST_OAUTH_KEY"] }}
76 75
     end
77 76
   end
78
-end
77
+end